Repository navigation
docs(shipping): #549 S2-2 N03 TOCTOU threat model and P-N03 proposal (Phase 1) - #583
raylei50653 wants to merge 6 commits into
Conversation
…source Phase 1 of the #549 S2-2 N03 TOCTOU work: threat model, alternatives, contract matrix and research evidence for a host-sealed memfd whose source descriptor and bytes the loader auditor verifies against the fixed operator path. No production source changes; N03 MB-41 stays OPEN and the aggregate byte scope stays hashed_before_load. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Revision 2 identifies each mapped object from /proc/self/maps (path and inode, not device: overlayfs reports different devices) so relative or spoofed aliases to descriptors are refused, keeps the operator memfd open with a process-wide registry and a post-dlopen mapping check, and narrows I1/I2 and the failure semantics to what the checks establish. Matrix r6 42/42, GPU smoke r2 6/6. N03 MB-41 stays OPEN. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Revision 3 states P2 as main's audit-time observation with the historical open-path residual left to an owner decision, keys the operator registry by SHA-256 and source path, discards overlong /proc/self/maps records, compares device and inode for the memfd, and records the '(deleted)'-name and non-file-backed l_ld restrictions. Matrix r7 45/45, GPU smoke r3 6/6. N03 MB-41 stays OPEN. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Revision 3a closes the two minor review r3 items: the probe and GPU smoke post-checks discard overlong /proc/self/maps records instead of parsing their continuation, and the unfounded PATH_MAX bound on kernel-rendered paths is removed. Matrix r8 45/45, GPU smoke r4 6/6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Revision 3b closes the review r4 items: the host and GPU smoke post-checks read whole /proc/self/maps records with getline, the auditor parser reads from a descriptor so it can be tested, and all three pass 12 synthetic boundary cases each. The auditor's refusal of mapped paths of PATH_MAX bytes or more is recorded as a compatibility restriction. Matrix r9 45/45, GPU smoke r5 6/6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Revision 3c closes the review r5 coverage items: a header-shaped decoy now starts the auditor's 65,535-byte continuation, and 8192/65535-byte target records are tested with and without a final newline. Each of the three parsers passes 14/14; matrix r10 45/45, GPU smoke r6 6/6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Closing as superseded (not merged). Not a merge conflict: GitHub reports this PR as mergeable. It is closed because its content is stale and later work has replaced it. This Draft holds the Phase 1 research for the P-N03 rev 3c prototype (sealed memfd + maps identity). It showed that the candidate design was feasible. It did not make N03 a product-level security guarantee. The follow-up work has since landed on main:
Current status, per #550: MB-41 is CLOSED (bounded); S2-2 is PARTIAL; V5 qualified is Merging the 1,962 lines here would put old status claims back on main. The diff and the review history stay on this PR for the record. This closure does not restart N03 research and does not open a new issue. It is the Draft cleanup step under #550 §0A. |
Summary
Phase 1 of the #549 S2-2 N03 TOCTOU work (ADR 028 D5, CC-536-01-02, #550): threat model, alternatives, contract matrix and reproducible research evidence for P-N03 revision 3c.
Docs and research prototype only. No production loader, auditor, launcher, N03 bytes, allowlist, installed package or pin changes. N03 MB-41 stays OPEN, S2-2 stays PARTIAL, aggregate
load_verification.byte_scopestayshashed_before_load, and qualified V5 stays UNRESOLVED.distribution.status=local-only,owner_confirmation=null.Phase verdict: PARTIAL. Gate 1 is not a stop; production implementation (Phase 2) waits on owner decisions D-N03-1..6.
Design
S), hash the buffer.saccade-n03:src-fd=<S>(MFD_NOEXEC_SEAL, four seals) and hash it again on readback.dlopen("/proc/self/fd/<M>").l_ldisM(device+inode).Mopen, in a process-wide registry keyed by SHA-256 + source path./proc/self/mapsrecord (path+inode).d_path(S)== the fixed operator path, matching device/inode, and the same bytes as the fixed file.Findings worth knowing even without this design
/proc/self/fd;… (deleted)path.dlopenloads bytes other than the hashed ones after a rename or in-place write (B1–B3).Evidence (local-only raw evidence; hashes in the evidence JSON)
scripts/pre_push.shond0c50a55d0c50a55Independent read-only Codex reviews
cdf869534c7c0eba1d8d9abe7d1d04d199b0a86fEvery finding and its disposition is tabled in the document. Revision 3c addresses r5's two minor test-coverage items and has not been independently re-reviewed.
Failed predictions are retained: r1 C05, r2 C20 (
MFD_NOEXEC_SEALmemfds do load), r4 (overlayfs device mismatch on WSL libcuda) and r5 F2.Known limits / residuals (owner acceptance requested)
… (deleted);l_ldis not file-backed (untested);PATH_MAX.memfd_create,/procand executable memfd mappings; hosts lacking them are UNVERIFIED.Owner decisions requested
Stays Draft; do not merge. Merge needs separate authorization naming the final head. Checkpoint writeback to #549/#536/#550 follows only an authorized merge and main CI.
🤖 Generated with Claude Code